package com.hsc.yalebao.newui;

import android.annotation.SuppressLint;
import android.content.Intent;
import android.content.res.Resources;
import android.os.Bundle;
import android.text.format.DateUtils;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Adapter;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ListView;
import com.handmark.pulltorefresh.library.ILoadingLayout;
import com.handmark.pulltorefresh.library.PullToRefreshBase;
import com.handmark.pulltorefresh.library.PullToRefreshBase.Mode;
import com.handmark.pulltorefresh.library.PullToRefreshBase.OnRefreshListener;
import com.handmark.pulltorefresh.library.PullToRefreshListView;
import com.hsc.yalebao.base.BaseActivity;
import com.hsc.yalebao.base.MainActivity;
import com.hsc.yalebao.model.ZhaoPinBean;
import com.hsc.yalebao.weight.LogUtils;
import java.util.ArrayList;

@SuppressLint({"NewApi"})
public class UpNewZixunActivity extends BaseActivity
  implements View.OnClickListener
{
  private String MsgType = "tongzhi";
  private String TAG = "-DongTaiFragment-";
  private UpNewZixunAdapter adapter;
  int[] address = { 2131296294, 2131296295, 2131296296, 2131296297, 2131296298, 2131296299 };
  private int currentItem = 0;
  int[] des = { 2131296312, 2131296313, 2131296314, 2131296315, 2131296316, 2131296317 };
  int[] dizhi = { 2131296324, 2131296325, 2131296326, 2131296327, 2131296328, 2131296329 };
  int[] gongsiName = { 2131296282, 2131296283, 2131296284, 2131296285, 2131296286, 2131296287 };
  private boolean isRunning = true;
  private boolean isgonggao;
  private PullToRefreshListView listview;
  private MainActivity mainActivity;
  private ArrayList<ZhaoPinBean> messageList;
  int[] money = { 2131296300, 2131296301, 2131296302, 2131296303, 2131296304, 2131296305 };
  int oldPosition = 0;
  private int page = 1;
  private Resources resources = null;
  int[] tel = { 2131296318, 2131296319, 2131296320, 2131296321, 2131296322, 2131296323 };
  int[] youhuo = { 2131296306, 2131296307, 2131296308, 2131296309, 2131296310, 2131296311 };
  int[] zhiwei = { 2131296288, 2131296289, 2131296290, 2131296291, 2131296292, 2131296293 };

  private void init()
  {
    this.listview = ((PullToRefreshListView)findViewById(2131099717));
    if (this.adapter == null)
    {
      this.adapter = new UpNewZixunAdapter(this.messageList, this);
      this.adapter.setData(this.messageList);
      this.adapter.notifyDataSetChanged();
    }
    this.listview.setAdapter(this.adapter);
    this.listview.setOnItemClickListener(new AdapterView.OnItemClickListener()
    {
      public void onItemClick(AdapterView<?> paramAnonymousAdapterView, View paramAnonymousView, int paramAnonymousInt, long paramAnonymousLong)
      {
        ZhaoPinBean localZhaoPinBean = (ZhaoPinBean)((Adapter)paramAnonymousAdapterView.getAdapter()).getItem(paramAnonymousInt);
        Intent localIntent = new Intent(UpNewZixunActivity.this, NewZhaopinDetailActivity.class);
        localIntent.putExtra("data", localZhaoPinBean);
        UpNewZixunActivity.this.startActivity(localIntent);
      }
    });
    initRefresh();
  }

  private void initData()
  {
    this.messageList = new ArrayList();
    for (int i = 0; ; i++)
    {
      if (i >= this.zhiwei.length)
        return;
      ZhaoPinBean localZhaoPinBean = new ZhaoPinBean();
      localZhaoPinBean.setGongsiName(getResources().getString(this.gongsiName[i]));
      localZhaoPinBean.setZhiwei(getResources().getString(this.zhiwei[i]));
      localZhaoPinBean.setAddress(getResources().getString(this.address[i]));
      localZhaoPinBean.setMoney(getResources().getString(this.money[i]));
      localZhaoPinBean.setDes(getResources().getString(this.des[i]));
      localZhaoPinBean.setYouhuo(getResources().getString(this.youhuo[i]));
      localZhaoPinBean.setTel(getResources().getString(this.tel[i]));
      localZhaoPinBean.setDizhi(getResources().getString(this.dizhi[i]));
      this.messageList.add(localZhaoPinBean);
    }
  }

  private void initRefresh()
  {
    this.listview.setMode(PullToRefreshBase.Mode.DISABLED);
    this.listview.setOnRefreshListener(new PullToRefreshBase.OnRefreshListener()
    {
      public void onRefresh(PullToRefreshBase<ListView> paramAnonymousPullToRefreshBase)
      {
        String str = DateUtils.formatDateTime(UpNewZixunActivity.this, System.currentTimeMillis(), 524305);
        paramAnonymousPullToRefreshBase.getLoadingLayoutProxy().setLastUpdatedLabel(str);
        if (UpNewZixunActivity.this.listview.isHeaderShown())
          LogUtils.e(UpNewZixunActivity.this.TAG, "mPullRefreshListView刷新");
        UpNewZixunActivity localUpNewZixunActivity;
        for (UpNewZixunActivity.this.page = 1; ; localUpNewZixunActivity.page = (1 + localUpNewZixunActivity.page))
        {
          UpNewZixunActivity.this.listview.onRefreshComplete();
          return;
          LogUtils.e(UpNewZixunActivity.this.TAG, "mPullRefreshListView加载");
          localUpNewZixunActivity = UpNewZixunActivity.this;
        }
      }
    });
  }

  @SuppressLint({"ResourceAsColor"})
  public void onClick(View paramView)
  {
    paramView.getId();
  }

  public void onCreate(Bundle paramBundle)
  {
    super.onCreate(paramBundle);
    setContentView(2130903225);
    initData();
    init();
  }

  public void onDestroy()
  {
    super.onDestroy();
  }

  public void onResume()
  {
    super.onResume();
  }
}

/* Location:           C:\Users\user\Desktop\dd28_pcdd720\classes_dex2jar.jar
 * Qualified Name:     com.hsc.yalebao.newui.UpNewZixunActivity
 * JD-Core Version:    0.6.2
 */